﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MAPDavy.Repository;
using MAPDavy.Entities;
using Microsoft.Practices.Unity;

namespace MAPDavy.BusinessLogic
{
    public class TermBL:ITermBL
    {
        [Dependency]
        public ITermRepository  TermRepository { get; set; }

        public List<Term> GetFromTermByAnio(string anio)
        {
            return TermRepository.GetFromTermByAnio(anio);  
        }

        public Term GetFromTermById(int id)
        {
            return TermRepository.GetFromTermById(id);  
        }

        public void AddTerm(Term term)
        {
            TermRepository.AddTerm(term);  
        }

        public void UpdateTerm(Term term)
        {
            TermRepository.UpdateTerm(term);  
        }

        public void RemoveTerm(Int32 id)
        {
            TermRepository.RemoveTerm(id);
        }

        public bool CanRemoveTerm(int id)
        {
            return TermRepository.CanRemoveTerm(id);  
        }


        public void AddTestGrade(TestGrade testGrade)
        {
            TermRepository.AddTestGrade(testGrade); 
        }


        public void RemoveTestGrade(TestGrade testGrade)
        {
            TermRepository.RemoveTestGrade(testGrade); 
        }

        public bool CanRemoveTestGrade(TestGrade testGrade)
        {
            return TermRepository.CanRemoveTestGrade(testGrade);  
        }


        public List<CRFTemplate> GetFromCRFTemplateByTermId(int id)
        {
            return TermRepository.GetFromCRFTemplateByTermId(id);
        }
    }
}
